<template>
    <el-sub-menu :index="handlePath(item.path)" popper-append-to-body>
      <template #title>
        <svg-icon :name="item.meta.icon" />
        <span style="margin-left: 5px; line-height: 60px">
          {{ item.meta.name }}
        </span>
      </template>
      <slot />
    </el-sub-menu>
  </template>
  
  <script lang="ts">
  import { defineComponent } from "vue";
  import path from "path";
  
  export default defineComponent({
    props: {
      item: {
        type: Object,
        required: true,
      },
      fullPath: {
        type: String,
        default: "",
      },
    },
    setup(props) {
      const handlePath = (routePath: string) => {
        return path.resolve(props.fullPath, routePath);
      };
  
      return {
        handlePath,
      };
    },
  });
  </script>
  
  <style scoped>
  </style>